From 81265c2af93866eb909491fe294fe343ca0c1e60 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 7 Jun 2010 07:38:09 +0100 Subject: [PATCH] AMD: Workaround for erratum 411 Clear APIC TMICT when we mask APIC LVTT. Signed-off-by: Wei Wang --- xen/arch/x86/apic.c | 8 +++++++- xen/arch/x86/hpet.c | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c index bd3ae1a49a..248d373667 100644 --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -195,6 +195,9 @@ void clear_local_APIC(void) maxlvt = get_maxlvt(); + /* Work around AMD Erratum 411. This is a nice thing to do anyway. */ + apic_write_around(APIC_TMICT, 0); + /* * Masking an LVT entry on a P6 can trigger a local APIC error * if the vector is zero. Mask LVTERR first to prevent this. @@ -1184,7 +1187,10 @@ void disable_APIC_timer(void) { if (using_apic_timer) { unsigned long v; - + + /* Work around AMD Erratum 411. This is a nice thing to do anyway. */ + apic_write_around(APIC_TMICT, 0); + v = apic_read(APIC_LVTT); apic_write_around(APIC_LVTT, v | APIC_LVT_MASKED); } diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c index e67e5ce5d3..47cc82ea21 100644 --- a/xen/arch/x86/hpet.c +++ b/xen/arch/x86/hpet.c @@ -662,8 +662,7 @@ void hpet_broadcast_enter(void) spin_unlock(&ch->lock); } - /* Cancel any outstanding LAPIC timer event and disable interrupts. */ - reprogram_timer(0); + /* Disable LAPIC timer interrupts. */ disable_APIC_timer(); spin_lock(&ch->lock); -- 2.30.2